package com.codenum.codegenerator;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

/**
* the Xntcflyk type
*/
@SuppressWarnings("ALL")
public class Xntcflyk {


        private static volatile Xntcflyk instance;

        /**
        * 方法MethodMap
        */
        private Map<String, Method> methodMap = new HashMap<>(32);

        private Map<String, Object> saleTypeMap = new HashMap<>(64);

        public static Xntcflyk getInstance() {
            if (instance == null) {
                synchronized (Xntcflyk.class) {
                    if (instance == null) {
                        instance = new Xntcflyk();
                    }
                }
            }
            return instance;
        }


        private Xntcflyk() {

        }



    public  Boolean judgeCzlhppkazh(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeByhttwfkip(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeBgrfnjjjhr(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeBuxgzvrozq(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeWfjpzqsjyl(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeOemxmqrpbs(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeQksghlgvkh(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeXtirlzcswx(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeLjpwpomlkz(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeEyfvrzdcoy(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeEtpjjdwwsk(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }

    private String  czlhppkazh;
    private String  byhttwfkip;
    private String  bgrfnjjjhr;
    private String  buxgzvrozq;
    private String  wfjpzqsjyl;
    private String  oemxmqrpbs;
    private String  qksghlgvkh;
    private String  xtirlzcswx;
    private String  ljpwpomlkz;
    private String  eyfvrzdcoy;
    private String  etpjjdwwsk;


    public void setCzlhppkazh(String czlhppkazh){
    this.czlhppkazh = czlhppkazh;
    }

    public String getCzlhppkazh(){
    return this.czlhppkazh;
    }
    public void setByhttwfkip(String byhttwfkip){
    this.byhttwfkip = byhttwfkip;
    }

    public String getByhttwfkip(){
    return this.byhttwfkip;
    }
    public void setBgrfnjjjhr(String bgrfnjjjhr){
    this.bgrfnjjjhr = bgrfnjjjhr;
    }

    public String getBgrfnjjjhr(){
    return this.bgrfnjjjhr;
    }
    public void setBuxgzvrozq(String buxgzvrozq){
    this.buxgzvrozq = buxgzvrozq;
    }

    public String getBuxgzvrozq(){
    return this.buxgzvrozq;
    }
    public void setWfjpzqsjyl(String wfjpzqsjyl){
    this.wfjpzqsjyl = wfjpzqsjyl;
    }

    public String getWfjpzqsjyl(){
    return this.wfjpzqsjyl;
    }
    public void setOemxmqrpbs(String oemxmqrpbs){
    this.oemxmqrpbs = oemxmqrpbs;
    }

    public String getOemxmqrpbs(){
    return this.oemxmqrpbs;
    }
    public void setQksghlgvkh(String qksghlgvkh){
    this.qksghlgvkh = qksghlgvkh;
    }

    public String getQksghlgvkh(){
    return this.qksghlgvkh;
    }
    public void setXtirlzcswx(String xtirlzcswx){
    this.xtirlzcswx = xtirlzcswx;
    }

    public String getXtirlzcswx(){
    return this.xtirlzcswx;
    }
    public void setLjpwpomlkz(String ljpwpomlkz){
    this.ljpwpomlkz = ljpwpomlkz;
    }

    public String getLjpwpomlkz(){
    return this.ljpwpomlkz;
    }
    public void setEyfvrzdcoy(String eyfvrzdcoy){
    this.eyfvrzdcoy = eyfvrzdcoy;
    }

    public String getEyfvrzdcoy(){
    return this.eyfvrzdcoy;
    }
    public void setEtpjjdwwsk(String etpjjdwwsk){
    this.etpjjdwwsk = etpjjdwwsk;
    }

    public String getEtpjjdwwsk(){
    return this.etpjjdwwsk;
    }

    void setMethodMap(Map<String, Method> methodMap) {
        this.methodMap = methodMap;
    }

   void setSaleTypeMap(Map<String, Object> saleTypeMap) {
        this.saleTypeMap = saleTypeMap;
    }

    public Boolean judgeAttributeValue(String saleType, String methodName) {
        try {
            Object saleTypeObject = saleTypeMap.get(saleType);
            String targetMethod = methodName.replace("judge", "get");
            String attr = methodName.replace("judge", "");
            Method method = methodMap.get(targetMethod);
            Object invoke = method.invoke(saleTypeObject);
            return Objects.isNull(invoke) ? Boolean.FALSE : Objects.equals(invoke.toString().toLowerCase(), attr.toLowerCase());
        } catch (InvocationTargetException e) {
            throw new RuntimeException(e.getMessage());
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e.getMessage());
        }
    }

}